.class public Lcom/netease/mobistat/client/Handler/StatClientHandler;
.super Lorg/jboss/netty/channel/SimpleChannelUpstreamHandler;
.source "StatClientHandler.java"


# static fields
.field private static final LOGGER:Ljava/util/logging/Logger;


# direct methods
.method static constructor <clinit>()V
    .locals 1

    .prologue
    .line 27
    const-class v0, Lcom/netease/mobistat/client/Handler/DownlinkClientHandler;

    invoke-virtual {v0}, Ljava/lang/Class;->getName()Ljava/lang/String;

    move-result-object v0

    invoke-static {v0}, Ljava/util/logging/Logger;->getLogger(Ljava/lang/String;)Ljava/util/logging/Logger;

    move-result-object v0

    .line 26
    sput-object v0, Lcom/netease/mobistat/client/Handler/StatClientHandler;->LOGGER:Ljava/util/logging/Logger;

    .line 24
    return-void
.end method

.method public constructor <init>()V
    .locals 0

    .prologue
    .line 24
    invoke-direct {p0}, Lorg/jboss/netty/channel/SimpleChannelUpstreamHandler;-><init>()V

    return-void
.end method


# virtual methods
.method public channelConnected(Lorg/jboss/netty/channel/ChannelHandlerContext;Lorg/jboss/netty/channel/ChannelStateEvent;)V
    .locals 4
    .parameter "ctx"
    .parameter "e"
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/lang/Exception;
        }
    .end annotation

    .prologue
    .line 32
    invoke-interface {p2}, Lorg/jboss/netty/channel/ChannelStateEvent;->getChannel()Lorg/jboss/netty/channel/Channel;

    move-result-object v0

    .line 34
    .local v0, channel:Lorg/jboss/netty/channel/Channel;
    invoke-static {}, Lcom/netease/mobistat/util/Constant;->getStatinfo()Ljava/lang/String;

    move-result-object v2

    .line 35
    .local v2, statinfo:Ljava/lang/String;
    invoke-static {v2}, Lcom/netease/mobistat/util/StringUtil;->isBlank(Ljava/lang/String;)Z

    move-result v3

    if-nez v3, :cond_0

    .line 37
    invoke-interface {v0, v2}, Lorg/jboss/netty/channel/Channel;->write(Ljava/lang/Object;)Lorg/jboss/netty/channel/ChannelFuture;

    move-result-object v1

    .line 38
    .local v1, future:Lorg/jboss/netty/channel/ChannelFuture;
    const-string v3, ""

    invoke-static {v3}, Lcom/netease/mobistat/util/Constant;->setStatinfo(Ljava/lang/String;)V

    .line 39
    sget-object v3, Lorg/jboss/netty/channel/ChannelFutureListener;->CLOSE:Lorg/jboss/netty/channel/ChannelFutureListener;

    invoke-interface {v1, v3}, Lorg/jboss/netty/channel/ChannelFuture;->addListener(Lorg/jboss/netty/channel/ChannelFutureListener;)V

    .line 41
    .end local v1           #future:Lorg/jboss/netty/channel/ChannelFuture;
    :cond_0
    return-void
.end method

.method public exceptionCaught(Lorg/jboss/netty/channel/ChannelHandlerContext;Lorg/jboss/netty/channel/ExceptionEvent;)V
    .locals 4
    .parameter "ctx"
    .parameter "e"

    .prologue
    .line 45
    sget-object v0, Lcom/netease/mobistat/client/Handler/StatClientHandler;->LOGGER:Ljava/util/logging/Logger;

    sget-object v1, Ljava/util/logging/Level;->WARNING:Ljava/util/logging/Level;

    .line 46
    const-string v2, "\ufffd\u037b\ufffd\ufffd\u02f4\ufffd\ufffd\ufffdUnexpected exception from downstream."

    invoke-interface {p2}, Lorg/jboss/netty/channel/ExceptionEvent;->getCause()Ljava/lang/Throwable;

    move-result-object v3

    .line 45
    invoke-virtual {v0, v1, v2, v3}, Ljava/util/logging/Logger;->log(Ljava/util/logging/Level;Ljava/lang/String;Ljava/lang/Throwable;)V

    .line 47
    invoke-interface {p2}, Lorg/jboss/netty/channel/ExceptionEvent;->getChannel()Lorg/jboss/netty/channel/Channel;

    move-result-object v0

    invoke-interface {v0}, Lorg/jboss/netty/channel/Channel;->close()Lorg/jboss/netty/channel/ChannelFuture;

    .line 48
    return-void
.end method
